getCostCalculation

fun getCostCalculation(sec: Account, asOfDateInt: Int? = null, preparedTxns: TxnSet? = null, obtainCurrentBalanceToo: Boolean = false, unRealizedSaleTxn: SplitTxn? = null): CostCalculation

Returns a CostCalculation class for the given security account and given parameters. Added February 2024 by Stuart Beesley using the new CostCalculation class since MD2024(5100).

Return

CostCalculation class for the given security account and given parameters.

Since

MD2024(5100)

Parameters

sec

The security account.

asOfDateInt

The asof date (int) for the cost basis calculation (null will be derived to today/future)

preparedTxns

Normally null. Pass the txns (TxnSet) to be used to the class.

obtainCurrentBalanceToo

Normally false. Useful when a future dated balance exists. A CC class for current date can be retrieved.

unRealizedSaleTxn

Normally null. Pass an unRealizedSaleTxn (SplitTxn) to generate an unrealised gains sale.